<%@ page language="java" import="weaver.conn.RecordSet" pageEncoding="UTF-8" %>
<%@ page import="weaver.general.Util" %>
<script>

</script>
<%
   RecordSet rs = new RecordSet();

    //获取今日中间表数据的sql
    String sql = "select a.id as id1,a.khxxh,a.khxmc,a.lxh,b.khx,b.khxmc,b.id AS id2 from uf_SRM_JM_GYSKPZB_dt1 a,uf_khhxx b \n" +
            "where a.khxmc=b.khxmc and b.sfgb=1 and (a.khxxh !=b.khx or a.lxh !=b.id) group by a.id,a.khxxh,a.khxmc,a.lxh,b.khx,b.khxmc,b.id order by a.id";
    rs.executeQuery(sql);
    int count = 0;
    while(rs.next()){
        String id1 = Util.null2String(rs.getString("id1"));
        String khx = Util.null2String(rs.getString("khx"));
        String id2 = Util.null2String(rs.getString("id2"));
        boolean flag = rs.executeUpdate("update uf_SRM_JM_GYSKPZB_dt1 set lxh=?,khxxh=? where id=?",id2,khx,id1);
        count++;
        out.print( "count:"+count+"---------------更新状态："+flag+"<br/>" );
    }
%>
